package com.sanji.sjmallapp;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;

import com.sanji.sjmallmanager.activity.ActivityManager;
import com.sanji.sjmallutils.SharePreferenceUtil;
import com.umeng.analytics.MobclickAgent;

/**
 * Created by zsf on 16-12-8.
 */
public class BaseActivity extends AppCompatActivity {
    public Context mCtx;
    public Intent intent = null;
    public SharePreferenceUtil myShare = null;
    public ActionBar actionBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mCtx = this;
        intent = new Intent();
        //将activity加入
        ActivityManager.getInstance().addActivity(this);
        myShare = MallApplication.getApplication().myShare;
        actionBar = getSupportActionBar();
        actionBar.hide();
    }

    public void finishActivity() {
        //将activity删除
        ActivityManager.getInstance().finishActivity();
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);          //统计时长
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }
}



